<?php
include('includes.php');
$user = $_SESSION['user'];

echo $user->getId();

$q = usuariosQuery::create()->findPk($user->getId());

if(isset($q))
{
    if($q->getAdmin() == true)
    {
        $categoria = categoriaQuery::create()->findPk($_GET['id']);
        $categoria->delete();
    }
}
$host3 = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'categorias.php';
header("Location: http://" . $host3 . $uri . "/" . $extra);
die();

?>
